<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddStaffIndex extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('staff', function (Blueprint $table) {
            $table->index('company_id');
            $table->index('mobile');
            $table->unique(['company_id', 'mobile']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        $table->dropPrimary('staff_company_id_index');
        $table->dropPrimary('staff_company_id_mobile_unique');
        $table->dropPrimary('staff_mobile_index');
    }
}
